feat: Solana relayFeeCalculator and gasPriceOracle#980
feat: Solana relayFeeCalculator and gasPriceOracle#980bmzig merged 21 commits intoepic/svm-clientfrom
Conversation
Signed-off-by: bennett <bennett@umaproject.org>
Signed-off-by: bennett <bennett@umaproject.org>
Signed-off-by: bennett <bennett@umaproject.org>
Signed-off-by: bennett <bennett@umaproject.org>
|
I can confirm that the gas price oracle is giving reasonable estimates for priority fees/base fees (assuming that the fill transaction only requires a single signature). The relay fee calculator simulation is still failing somewhere in the fill instruction, and I haven't figured out if this is an issue with how the instruction is being created or if I am just testing with relay data values that would cause the SvmSpoke to revert, but even if it is incorrect, this should at most require a small change in |
Signed-off-by: bennett <bennett@umaproject.org>
|
I'm now getting both reasonable gas price estimations and reasonable compute unit estimations. |
Signed-off-by: bennett <bennett@umaproject.org>
Signed-off-by: bennett <bennett@umaproject.org>
| ): Promise<Address<string>> { | ||
| const [associatedToken] = await getProgramDerivedAddress({ | ||
| programAddress: ASSOCIATED_TOKEN_PROGRAM_ADDRESS, | ||
| seeds: [owner.toBuffer(), SvmAddress.from(tokenProgramId).toBuffer(), mint.toBuffer()], |
There was a problem hiding this comment.
Is the user of Buffer here a hangover from the contracts implementation? Seeds in Kit have to conform to type Seed = ReadonlyUint8Array | string;, so it should be OK to pass strings in; I think this should work:
| seeds: [owner.toBuffer(), SvmAddress.from(tokenProgramId).toBuffer(), mint.toBuffer()], | |
| seeds: [owner.toAddress(), tokenProgramId, mint.toAddress()], |
There was a problem hiding this comment.
I'm actually not too sure how the string encoding is supposed to work here, but each character is treated as a byte, so passing in a string here will have getProgramDerivedAddress interpret the input as 66 byte strings, not 32 bytes.
There was a problem hiding this comment.
Ah yeah, .toAddress() would be completely wrong. The kit readme has an example on how to supply the seeds correctly: https://github.com/anza-xyz/kit/blob/0bfe90b1c1e1c1a2dd90c46408c7cab995692f7b/packages/addresses/README.md#getprogramderivedaddress
Co-authored-by: Paul <108695806+pxrl@users.noreply.github.com>
Signed-off-by: bennett <bennett@umaproject.org>
Signed-off-by: bennett <bennett@umaproject.org>
Signed-off-by: bennett <bennett@umaproject.org>
Signed-off-by: bennett <bennett@umaproject.org>
Signed-off-by: bennett <bennett@umaproject.org>
Signed-off-by: bennett <bennett@umaproject.org>
Signed-off-by: bennett <bennett@umaproject.org>
This should implement the relayFeeCalculator (and by extension, the gasPriceOracle) for svm. It will contain some other utilities which are used by those structures.